package icontrolv2

class Cliente {
    
    int rut
    String dv
    String nombre
    String mail
    String sitioWeb
    String descripcion
    
    static hasMany              = [proyectos:Proyecto, direcciones: Direccion, facturas:Factura]

    static constraints          = {
        rut unique:true, blank:false
        dv blank:false
        nombre blank:false
        mail email:true
    }
   /* def list = {
        if(!params.max) params.max = 10

        if(params?.format && params.format != "html"){
            response.contentType = grailsApplication.config.grails.mime.types[params.format]
            response.setHeader("Content-disposition", "attachment; filename=Cliente.${params.extension}")


            List fields = ["rut", "dv","nombre","mail","descripcion"]
           // Map labels = ["rut": "RUT", "dv": "DV"]



            // Formatter closure
            def upperCase = { domain, value ->
                return value.toUpperCase()
            }

           Map formatters = [rut: upperCase]
           Map parameters = [dv: "digito verfificaod", "column.widths": [0.2, 0.3, 0.5]]

            exportService.export(params.format, response.outputStream, Cliente.list(params), fields)
        }

             [clienteInstanceList:Cliente.list(params)]
    }

         */
}